package com.yulinlin.web3j.chain;

import com.yulinlin.web3j.domain.EIP20Interface;
import com.yulinlin.web3j.domain.EIP20InterfaceToken;
import com.yulinlin.web3j.domain.ETHSubject;
import org.web3j.protocol.Web3j;
import org.web3j.protocol.http.HttpService;

public class EthBlackChain implements BlackChain {

    private Web3j web3 ;

    public EthBlackChain(String ip) {
        web3 = Web3j.build(new HttpService(ip));
    }

    public Web3j getWeb3() {
        return web3;
    }

    @Override
    public ETHSubject createSubject(String privateKey) {
        return new ETHSubject(web3,privateKey);
    }

    public void shutdown(){
        web3.shutdown();
    }
}
